<div class="roles view">
<h2><?php echo $role['Role']['nombre']; ?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Descripción'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $role['Role']['descripcion']; ?>
			&nbsp;
		</dd>
	</dl>
<div class="related">
	<h3><?php echo 'Usuarios de tipo '.$role['Role']['nombre'];?></h3>
	<?php if (!empty($role['User'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __(''); ?></th>
		<th><?php __(''); ?></th>
		<th class="actions"><?php __('');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($role['User'] as $user):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		$user1 = $user['nombres'].' '.$user['apellido_paterno'].' '.$user['apellido_materno'];
		?>
		<tr<?php echo $class;?>>

			<td>
			<?php echo $this->Html->link($user1, array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
		</td>
			<td>
			<td class="actions">
				<?php echo $this->Html->link(__('Editar', true), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
				<?php echo $this->Html->link(__('Eliminar', true), array('controller' => 'users', 'action' => 'delete', $user['id']), null, sprintf(__('¿Esta seguro que desea eliminar el usuario %s?', true), $user1)); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('Nuevo Usuario', true), array('controller' => 'users', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>

</div>
<div class="actions">
	<h3><?php __('Acciones'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Editar Rol', true), array('action' => 'edit', $role['Role']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Eliminar Rol', true), array('action' => 'delete', $role['Role']['id']), null, sprintf(__('¿Está seguro que desea eliminar el rol  %s?', true), $role['Role']['nombre'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Roles', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nuevo Rol', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Usuarios', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nuevo Usuario', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
	</ul>
</div>

